package controller

import (
	"gin-chat/pkg"
	"gin-chat/router/response"
	"gin-chat/service"
	"github.com/gin-gonic/gin"
	"net/http"
)

//好友相关接口，好友列表
func Friends(c *gin.Context) {
	app := response.Gin{C: c}
	get, exists := c.Get("uuid")
	if !exists {
		app.Response(http.StatusInternalServerError, pkg.InternalServerError, nil)
		return
	}
	uuid := get.(int64)
	list := service.FriendsList(uuid)
	app.Response(http.StatusOK, pkg.Success, list)
}
